var timer = null;
export default {
	data() {
		return {
			loadingType: 0,//定义加载方式 0---contentdown  1---contentrefresh 2---contentnomore
			contentText: {
				contentdown:'上拉加载更多',
				contentrefresh: '正在加载...',
				contentnomore: '到底了~',
			},
			page:1,
			limit:10,
			last_page:1,
			opsInfo:{}
		}
	},
	onLoad(ops) {
		this.opsInfo = ops;
		this.getData()
	},
	onPullDownRefresh() {
		//下拉刷新的时候请求一次数据
		this.page = 1;
	    this.getData();
	},
	//触底
	onReachBottom() {
		if (timer != null) {
			clearTimeout(timer);
		}
		timer = setTimeout(()=> {
			this.getmoreNews();
		}, 1000);
	},
}